package com.dd.stack.file.pojo.DO;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dd.stack.common.util.annotation.Attention;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Author liuxianmeng
 * @CreateTime 2024/10/23 0:05
 * @Description Excel导入商品信息DO类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("ops_excel_product")
public class ExcelProductDO {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ExcelProperty("商品ID")
    private Long productId;
    @ExcelProperty("商品名称")
    private String productName;
    @ExcelProperty("价格")
    private Double price;
    @ExcelProperty("库存数量")
    private Integer stock;
    @ExcelProperty("创建时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @Attention("【注意】@DateTimeFormat 使用的是easyExcel包下的" +
            "@DateTimeFormat的日期格式要和Excel的格式一样")
    private LocalDateTime createTime;
}
